<div class="box box-solid">
    <div class="box-body table-responsive ">
        <table class="table table-hover table-bordered">
            <tr>
                <th>账号</th>
                <th>状态</th>
                <th class="align-center" width="30%">操作</th>
            </tr>
    <?php if (!empty($data['managers'])) : ?>
    <?php foreach ($data['managers'] as $manager) : ?>
        <tr>
            <td><?php echo $manager['name']; ?></td>
            <td>
                <?php if($manager['status'] == Manager::MAN_STATUS_NORMAL) : ?>
                    <span>正常</span>
                <?php  else : ?>
                    <span class="f_red">禁用</span>
                <?php endif; ?>
            </td>
            <td class="align-center tool-bar">
                    <a target='_blank' href="<?php echo $this->createUrl('manager/qrimg/id/'.$manager['id']); ?>">绑定微信二维码</a>
                    <a target='_blank' href="<?php echo $this->createUrl('option/index/u_id/'.$manager['id']); ?>">查看操作日志</a>
                <?php if ($manager['id'] != 1) : ?>
                    <a href="<?php echo $this->createUrl('manager/reset/id/'.$manager['id']); ?>">重置密码</a>
                       <?php if($this->admin_name == 'admin' || !array_key_exists('manager/edit',$this->sp['广告']) || (array_key_exists('manager/edit',$this->sp['广告']) && in_array('manager/edit',$this->user_sp))): ?>
                    <a href="<?php echo $this->createUrl('manager/edit/id/'.$manager['id']); ?>">编辑</a>
                       <?php endif; ?>
                    <?php if($manager['status'] == Manager::MAN_STATUS_NORMAL) : ?>
                      <?php if($this->admin_name == 'admin' || !array_key_exists('manager/disable',$this->sp['广告']) || (array_key_exists('manager/disable',$this->sp['广告']) && in_array('manager/disable',$this->user_sp))): ?>
                        <a href="<?php echo $this->createUrl('manager/disable/id/'.$manager['id']); ?>">禁用</a>
                    <?php  else : ?>
                        <a href="<?php echo $this->createUrl('manager/enable/id/'.$manager['id']); ?>">启用</a>
                    <?php endif; ?>
                   <?php endif; ?>
                    <a  onclick="return confirm('确定要删除吗？');" href="<?php echo $this->createUrl('manager/delete/id/'.$manager['id']); ?>">删除</a>
                <?php endif; ?>
            </td>
        </tr>
     <?php endforeach; ?>
    <?php endif; ?>
        </table>
    </div>
    <div class="box-footer clearfix">
    <a class="btn btn-default pull-left" href="<?php echo $this->createUrl('manager/add') ?>"><i class="fa fa-plus"></i> 添加新管理员</a>
    <?php if(!empty($data['managers'])): ?>
        <?php $this->widget('BLinkPager', array('pages'=>$data['pages'])); ?>
    <?php endif; ?>
    </div>

</div>
